<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header"><?= $navName ?></div>
        <div class="layui-card-body">
            <form id="addFrm" class="layui-form" action="" lay-filter="component-form-group">
                <input type="hidden" name="id" value="<?= !empty($editData['id']) ? $editData['id'] : 0; ?>">
                <div class="layui-form-item">
                    <label class="layui-form-label">车牌号码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="car_number" value="<?= !empty($editData['car_number']) ? $editData['car_number'] : ""; ?>" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">本卡号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="zibianhao" value="<?= !empty($editData['zibianhao']) ? $editData['zibianhao'] : ""; ?>" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">车型</label>
                    <div class="layui-input-inline">
                        <select name="car_type" lay-search>
                            <option value=""></option>
                            <?php foreach ($carType as $k => $v) { ?>
                                <option value="<?= $k ?>"<?= !empty($editData["car_type"]) && $editData["car_type"] == $k ? " selected" : "" ?>><?= $v["name"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">所属供应商</label>
                    <div class="layui-input-inline">
                        <select name="custom_id" lay-search>
                            <option value=""></option>
                            <?php foreach ($gongyingshang as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["custom_id"]) && $editData["custom_id"] == $v["id"] ? " selected" : "" ?>><?= $v["cmp_name"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">调度</label>
                    <div class="layui-input-inline">
                        <select name="diaodu_user_id" lay-search>
                            <option value=""></option>
                            <?php foreach ($diaodu as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["diaodu_user_id"]) && $editData["diaodu_user_id"] == $v["id"] ? " selected" : "" ?>><?= $v["truename"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">车务经理</label>
                    <div class="layui-input-inline">
                        <select name="cwjl_user_id" lay-search>
                            <option value=""></option>
                            <?php foreach ($cwjl as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["cwjl_user_id"]) && $editData["cwjl_user_id"] == $v["id"] ? " selected" : "" ?>><?= $v["truename"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">主驾</label>
                    <div class="layui-input-inline">
                        <select name="zhujia_driver_id" lay-search>
                            <option value=""></option>
                            <?php foreach ($zhujia as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["zhujia_driver_id"]) && $editData["zhujia_driver_id"] == $v["id"] ? " selected" : "" ?>><?= $v["driver_name"] . "/" . $v["tel"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label red-start">副驾</label>
                    <div class="layui-input-inline">
                        <select name="fujia_driver_id" lay-search>
                            <option value=""></option>
                            <?php foreach ($zhujia as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["fujia_driver_id"]) && $editData["fujia_driver_id"] == $v["id"] ? " selected" : "" ?>><?= $v["driver_name"] . "/" . $v["tel"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">使用状态</label>
                    <div class="layui-input-block">
                        <?php
                        foreach ($status as $k => $v) {
                            ?>
                            <input type="radio" name="status_id" value="<?= $k ?>"<?= isset($editData["status_id"]) && $editData['status_id'] == $k ? " checked" : ($k == 1 && !isset($editData['status_id']) ? " checked" : "") ?> title="<?= $v["name"] ?>">
                        <?php } ?>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn customize" lay-filter="formDemo" id="submitBtn">确定提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    var doAddUrl = "<?= $doAddUrl ?>";
    var listUrl = "<?= $this->projectSet["url"]["list"] ?>";
    var backUrl = "<?= isset($backUrl) ? $backUrl : "" ?>";
</script>
<script src="<?= PUBLIC_URL . "/" . $this->projectSet["file"]["js"] . "/add.js?" . rand() ?>"></script>
<script>
    layui.use(['laypage', 'layer', 'form', 'upload'], function () {
        var laypage = layui.laypage,
                frm = layui.form,
                layer = layui.layer,
                upload = layui.upload;
    });
</script>
